<template>
    <div>
        <!-- action：处理图像的后台接口地址; -->
        <!-- :on-preview="handlePictureCardPreview"：处理图片的预览 -->
        <!-- :on-remove="handleRemove"：处理图片的移除 -->
        <!-- :on-success="successHandler"：处理图像成功的响应 -->
        <div style="text-align:center">
            <el-upload
                action="http://localhost:8888/recognition/cars"
                list-type="picture-card"
                :on-success="successHandler">
                <i class="el-icon-plus"></i>
            </el-upload>
        </div>

        <div>
            <h3>识别结果：</h3>
            <el-table :data="resp.result">
                <el-table-column label="精确度" align="center" prop="score"></el-table-column>
                <el-table-column label="生产年份" align="center" prop="year"></el-table-column>
                <el-table-column label="车辆型号" align="center" prop="name"></el-table-column>
            </el-table>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return {
            resp :{}
        }
    },
    methods:{
        successHandler(resp){
            // 将后台返回的响应结果赋值给当前实例当中的resp
            this.resp = resp;
        }
    },
    created(){

    }
}
</script>
<style lang="sass" scoped>
    
</style>